Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job and instance as well-known labels in prometheus receiver #2897

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

bjrara
Copy link
Contributor

@bjrara bjrara commented Apr 6, 2021

In Prometheus, job and instance are the two auto generated labels, however they are both dropped by prometheus receiver. Although these information is still available in service.name and host:port, it breaks the data contract for most Prometheus users (who use job and instance to consume metrics in their own system).
This PR adds job and instance as well-known labels in prometheus receiver to fix the issue.

Link to tracking Issue:
#575
#2499
#2363
open-telemetry/prometheus-interoperability-spec#7

@bjrara bjrara requested a review from a team April 6, 2021 17:26
@bjrara bjrara force-pushed the prometheus_receiver branch from e6f1024 to 213e1be Compare April 6, 2021 18:43
@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #2897 (213e1be) into main (80a415d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2897   +/-   ##
=======================================
  Coverage   91.74%   91.74%           
=======================================
  Files         286      286           
  Lines       15086    15088    +2     
=======================================
+ Hits        13841    13843    +2     
  Misses        851      851           
  Partials      394      394           
Impacted Files Coverage Δ
...eceiver/prometheusreceiver/internal/transaction.go 90.90% <100.00%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80a415d...213e1be. Read the comment docs.

Copy link
Member

@mxiamxia mxiamxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mxiamxia
Copy link
Member

@rakyll @alolita

@tigrannajaryan
Copy link
Member

@bjrara which of the linked issues are fully resolved by this PR?

@tigrannajaryan tigrannajaryan merged commit 2b33043 into open-telemetry:main Apr 16, 2021
@bjrara
Copy link
Contributor Author

bjrara commented Apr 17, 2021

@bjrara which of the linked issues are fully resolved by this PR?

Thanks for the merge!
#2499

@rakyll
Copy link
Contributor

rakyll commented Apr 20, 2021

#2964 should address this issue.

bogdandrutu pushed a commit that referenced this pull request Apr 22, 2021
…orter (#2979)

This is a follow up to #2897.

Fixes #575
Fixes #2499
Fixes #2363
Fixes open-telemetry/prometheus-interoperability-spec#37
Fixes open-telemetry/prometheus-interoperability-spec#39
Fixes open-telemetry/prometheus-interoperability-spec#44

Passing compliance tests:

$ go test --tags=compliance -run "TestRemoteWrite/otelcollector/Job.+" -v ./
=== RUN TestRemoteWrite
=== RUN TestRemoteWrite/otelcollector
=== RUN TestRemoteWrite/otelcollector/JobLabel
=== PAUSE TestRemoteWrite/otelcollector/JobLabel
=== CONT TestRemoteWrite/otelcollector/JobLabel
--- PASS: TestRemoteWrite (10.02s)
--- PASS: TestRemoteWrite/otelcollector (0.00s)
--- PASS: TestRemoteWrite/otelcollector/JobLabel (10.02s)
PASS
ok github.com/prometheus/compliance/remote_write 10.382s
$ go test --tags=compliance -run "TestRemoteWrite/otelcollector/Instance.+" -v ./
=== RUN TestRemoteWrite
=== RUN TestRemoteWrite/otelcollector
=== RUN TestRemoteWrite/otelcollector/InstanceLabel
=== PAUSE TestRemoteWrite/otelcollector/InstanceLabel
=== CONT TestRemoteWrite/otelcollector/InstanceLabel
--- PASS: TestRemoteWrite (10.01s)
--- PASS: TestRemoteWrite/otelcollector (0.00s)
--- PASS: TestRemoteWrite/otelcollector/InstanceLabel (10.01s)
PASS
ok github.com/prometheus/compliance/remote_write 10.291s
$ go test --tags=compliance -run "TestRemoteWrite/otelcollector/RepeatedLabels.+" -v ./
=== RUN TestRemoteWrite
=== RUN TestRemoteWrite/otelcollector
--- PASS: TestRemoteWrite (0.00s)
--- PASS: TestRemoteWrite/otelcollector (0.00s)
testing: warning: no tests to run
PASS
@eugenberend
Copy link

After this PR was merged, I still don't see instance and job labels

@awx-fuyuanchu
Copy link

I'm using version 0.55.0 and I still don't see instance and job labels.

hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
…x-agent (open-telemetry#2897)

* Bump github.com/hashicorp/vault in /pkg/signalfx-agent

Bumps [github.com/hashicorp/vault](https://github.com/hashicorp/vault) from 1.12.2 to 1.12.5.
- [Release notes](https://github.com/hashicorp/vault/releases)
- [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md)
- [Commits](hashicorp/vault@v1.12.2...v1.12.5)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/vault
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Antoine Toulme <atoulme@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants